package com.flnet.spsys.utils;

public class ResultJson {
    private String code = "200";
    private String message;
    private Object data;

    public String getStatus() {
        return code;
    }

    public void setStatus(String status) {
        this.code = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public ResultJson() {
        super();
    }

    private ResultJson(String status, String message, Object data) {
        super();
        this.code = status;
        this.message = message;
        this.data = data;
    }

    public static ResultJson success(Object data) {
        return new ResultJson("200", "OK", data);
    }

    public static ResultJson failure(String message, Object data) {
        return new ResultJson("500", message, data);
    }

    @Override
    public String toString() {
        return "ResultJson [status=" + code + ", message=" + message + ", data=" + data + "]";
    }

}